package cn.itcast.travel.web.servlet.comment;

import cn.itcast.travel.service.CommentService;
import cn.itcast.travel.service.impl.CommentServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "Getcomment", value = "/Getcomment")
public class Getcomment extends HttpServlet {
    CommentService service=new CommentServiceImpl();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id=request.getParameter("id");
        ObjectMapper ob=new ObjectMapper();
        ob.writeValue(response.getWriter(),service.getallcomment(id));
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
